class BusinessResponse {
  constructor (data = {}) {
    if (data && typeof data === 'object' && !Array.isArray(data)) {
      this.code = data.code
      this.data = data.data
      this.message = data.msg
    } else {
      this.code = '0'
      this.data = data
    }
  }

  getCode () {
    return this.code
  }

  getData () {
    return this.data
  }

  getMessage () {
    return this.message
  }
}

export default BusinessResponse